$(function () {
    $('#mtjbackid').click(function () {
        window.location.href="person.html"
    })

    // 专家基本信息
    $.ajax({
        type: "get",
        url: "data/getInfoById.json",
        dataType: "json",
        data: {
            // time: new Date().getTime(),
            // id: userid
        },
        success: function (data) {
            var datas = data.data;
            for (var m in datas) {
                $("#check_info input[name=" + m + "]").val(datas[m]);
            }
            $("#usernameid").text(data.name);
            $("#birthdateid").text(data.voBirthday);
            $("#nationid").text(data.nation);
            $("#graduationucid").text(data.graduationuc);
            $("#nowmajorid").text(data.nowmajor);
            $("#higheducationid").text(data.higheducation);
            $("#sexid").text(data.sex);  //
            $("#nationalityid").text(data.nationality);
            $("#partyid").text(data.party);
            $("#majorid").text(data.major);
            $("#knowmajorid").text(data.knowmajor);
            $("#highdegreeid").text(data.highdegree);
            if (data.photo == '') {
                $("#photoid").attr('src', "images/user.jpg");
            } else {
                //$("#photoid").attr('src',"data:image/png;base64," + data.photo);
                $("#photoid").attr('src', "/userphoto/" + data.photo);
            }
            $("#workunitnameid").text(data.workunitname + data.workoffices);
            $("#unittypeid").text(data.unittype);
            $("#addressprovinceid").text(data.voAddressProvince);//
            $("#addresscityid").text(data.voAddressCity);//
            $("#addressdetailid").text(data.addressdetail);
            $("#pluralityid").text(data.plurality);
            $("#qualificationsid").text(data.qualifications);
            $("#dutyid").text(data.duty);
            $("#mobileid").text(data.mobile);
            $("#documenttypeid").text(data.documenttype); //
            $("#banknoid").text(data.bankno);
            $("#contactsid").text(data.contacts);
            $("#emailid").text(data.email);
            $("#unittitieid").text(data.unittitie);
            $("#phoneid").text(data.phone);
            $("#documentcodeid").text(data.documentcode);
            $("#openbankid").text(data.openbank);
            $("#contactsmobileid").text(data.contactsmobile);
            $("#zipcodeid").text(data.zipcode);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert(textStatus);
            window.location.href = '/expertlib/login.html';
        }
    });

//复选框内容
    var checkarr = [
        {id: 1, name: "基础研究"},
        {id: 2, name: "应用研究"},
        {id: 3, name: "投资金融"},
        {id: 4, name: "海域海岛论证"},
        {id: 5, name: "战略咨询"},
        {id: 6, name: "教育教学"},
        {id: 7, name: "海洋环境评价"},
        {id: 8, name: "海洋环境"},
        {id: 9, name: "海洋论证"}
    ]
    $.each(checkarr, function (index, ele) {
        if ((index + 1) % 3 == 0) {
            $('#gzxzid').append('<label style="width: 28%" for="check' + ele.id + '"><input name="" class="input_right" id="check' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        } else if (index == checkarr.length - 1 && (index + 1) % 3 != 0) {
            $('#gzxzid').append('<label class="input_none"  for="check' + ele.id + '"><input name="" id="check' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        } else {
            $('#gzxzid').append('<label for="check' + ele.id + '"><input name="" id="check' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        }

    })
    $.each(checkarr, function (index, ele) {
        if ((index + 1) % 3 == 0) {
            $('#gzxzid1').append('<label style="width: 28%" for="check1' + ele.id + '"><input name="" class="input_right" id="check1' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        } else if (index == checkarr.length - 1 && (index + 1) % 3 != 0) {
            $('#gzxzid1').append('<label class="input_none"  for="check1' + ele.id + '"><input name="" id="check1' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        } else {
            $('#gzxzid1').append('<label for="check1' + ele.id + '"><input name="" id="check1' + ele.id + '" type="checkbox">' + ele.name + '</label>');
        }

    })

})








